<template>
  <Fragment>
    <div class="head-wrap borderBottom-1px">
      <div class="title left borderBottom-2px">{{title}}</div>
      <div class="operate right">                  
      </div>
    </div>
    <div class="content-wrap">
      <div class="chart-content" ref="outpatientIncomeStatistics">
        2019
      </div>                         
    </div>
    <img src="@/assets/images/card819.png" class="card819" alt="">
  </Fragment>
</template>

<script>
import * as echarts from 'echarts';
import { Fragment } from 'vue-fragment'
export default {
  name:'box-card-single-analysis6-zhichengtongjizhanbi',
  components:{Fragment},
  props:{
    title:{
      type:String
    }
  },
  mounted(){
    this.makeData()
  },
  methods:{
    makeData(){
      let option4 = {
        color: ["#4EC4FF", "#FD8552", "#6D86CF", "#FA8383", "#FBD171"],
          series: [
              {
                  type: 'funnel',
                  name: '预期',
                  top: '10%',
                  left: '10%',
                  
                  width: '75%',
                  height: '80%',
                  label: {
                      normal: {
                          position: 'right',
                          formatter: '{b}{a}',
                      },
                      emphasis: {
                          formatter: '{b}: {c}({d}%)',
                      },
                  },
                  labelLine: {
                      normal: {
                          show: false,
                      },
                  },
                  itemStyle: {
                      normal: {
                          opacity: 0.8,
                      },
                  },
                  data: [
                      { name: '高级', value: 100 },
                      { name: '中级', value: 80 },
                      { name: '师级', value: 60 },
                      { name: '士级', value: 40 },
                      { name: '其他', value: 20 },
                  ],
              },
              {
                  type: 'funnel',
                  name: '实际',
                  top: '10%',
                  left: '15%',
                  
                  width: '65%',
                  height: '80%',
                  label: {
                      normal: {
                          position: 'inside',
                          formatter: '{c}%',
                      },
                      emphasis: {
                          formatter: '{b}: {c}({d}%)',
                      },
                  },
                  data: [
                      { name: '高级', value: 80 },
                      { name: '中级', value: 50 },
                      { name: '师级', value: 30 },
                      { name: '士级', value: 10 },
                      { name: '其他', value: 5 },
                  ],
              },
          ],
      };
      this.makeGraph(this.$refs.outpatientIncomeStatistics,option4)

    },
    makeGraph(ref,option){
      let myChart=echarts.init(ref)
      myChart.setOption(option)
    }
  }
}
</script>
<style lang="less" scoped>
.left{float: left;}
.right{float: right;}
.borderBottom-1px{
  border-bottom: .01rem solid #7787C7 ;
}
.borderBottom-2px{
  border-bottom: .02rem solid #7787C7 ;
}
.head-wrap{
    font-size: .16rem;
    color:#ffffff;
    overflow: hidden;
    .title{
      height: .26rem;
      line-height: .262rem;
    }
    .operate{
      span{
        height: .26rem;
        line-height: .26rem;
        display: inline-block;
        cursor: pointer;
        background: url('~@/assets/images/671.png') no-repeat center center;
        background-size: contain;
        padding: 1px .2rem;
      }
      span.active{
        background: url('~@/assets/images/670.png') no-repeat center center;
        background-size: contain;
        padding: 1px .2rem;
      }
    }
  }
  .content-wrap{
    width: 100%;
    height:calc( (100vh - 1.23rem) / 2 - .36rem) ;
    .chart-content{
      width: 100%;
      height:calc( (100vh - 1.23rem) / 2 - .36rem) ;
      height:calc( (100vh - 1.23rem) / 2 - .36rem) ;
      float: left;
      overflow: hidden;
    }
  }
  img{width: 100%;float: left;}
</style>